package com.dbq.fast.common.net.mock.mockApi;

import com.dbq.fast.common.net.mock.MockInterface;
import com.dbq.fast.common.net.mock.MockRouter;

/**
 * Created by sunkai on 2017/10/30.
 */

public class MockVPNConfig implements MockInterface {

    public static final String URL_GET_VPN = MockRouter.BASE_URL + "/vpn/queryvpn2";
    public static final String URL_UPLOAD_VPN_STATE = MockRouter.BASE_URL + "/uploadVpnState";

    @Override
    public byte[] getResponse(String url) {
        String result1 ="{\n" +
                "    \"code\": 200,\n" +
                "    \"msg\": \"成功\",\n" +
                "    \"data\": {\n" +
                "        \"server\": \"47.92.165.1\",\n" +
                "        \"server_port\": 40087,\n" +
                "        \"password\": \"test2\",\n" +
                "        \"method\": \"aes-256-cfb\",\n" +
                "        \"ip\": \"10.8.0.2\",\n" +
                "        \"dns\": [\n" +
                "            \"8.8.8.8\",\n" +
                "            \"114.114.114.114\",\n" +
                "            \"8.8.8.8\"\n" +
                "        ],\n" +
                "        \"proxy_domain\": [ \n" +
                "      \"qq.com\",\n" +
                "      \"google.com\",\n" +
                "      \"xiami.com\",\n" +
                "      \"baidu.com\",\n" +
                "      \"iqiyi.com\",\n" +
                "      \"qualcomm.cn\"\n" +
                "        ],\n" +
                "        \"userServiceName\": \"体验套餐\",\n" +
                "        \"userSetMealAvailableTime\": 68957000,\n" +
                "        \"userSetMealAvailableDataTraffic\": \"5G\"\n" +
                "    }\n" +
                "}";

        String result2 = "{\n" +
                "    \"code\":200,\n" +
                "    \"msg\":\"节点不可用\",\n" +
                "    \"data\":{\n" +
                "        \"vpnStatus\":1\n" +
                "    }\n" +
                "}\n";

        String result = "";
        switch (url) {
            case URL_GET_VPN:
                result = result1;
                break;
            case URL_UPLOAD_VPN_STATE:
                result = result2;
                break;
        }
        return result.getBytes();
    }
}
